Skip to content

Conversation

@dkropachev
Copy link
Contributor

  1. Switch to CPack
  2. Add workflows to build packages and populate existing release with them

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have implemented Rust unit tests for the features/changes introduced.
  • I have enabled appropriate tests in Makefile in {SCYLLA,CASSANDRA}_(NO_VALGRIND_)TEST_FILTER.
  • I added appropriate Fixes: annotations to PR description.

@dkropachev dkropachev force-pushed the dk/switch-to-cpack-for-packaging branch 15 times, most recently from 81c2641 to 4c2a4dd Compare October 6, 2025 19:42
Copy link
Contributor

@wprzytula wprzytula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general, the approach looks correct. Not knowing CPack, I'm not sure though.

MAINTENANCE.md Outdated
Comment on lines 38 to 40
11. Build binary packages with CPack on each target platform (Linux, macOS, Windows). The README provides the exact command sequence (`cmake -S`, `cmake --build`, `cpack -G <generator>`). If you do not have access to the platforms locally, trigger a run of the reusable workflow `.github/workflows/build-cpack-packages.yml` from another workflow and download the resulting artifacts.
12. Go to https://github.com/scylladb/cpp-rust-driver/releases , click the `Draft new release` button and follow the procedure to create a new release on GitHub. Use the release notes as its description.
13. After the release is published, the `Attach Packages to Release` workflow (`.github/workflows/release-upload-packages.yml`) automatically builds fresh packages using CPack and uploads every artifact to the release. Verify that the workflow finished successfully and that RPM/DEB/MSI/PKG/DMG files are attached.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ What is the intended difference between building packages in point 11 and 13?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, please take a look.

README.md Outdated
Comment on lines 446 to 443
Debian packages set shlibdeps automatically; RPM packages target the
`Applications/Databases` group and use release number `1` by default.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ What does it mean? It's all Greek to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated, please take a look

README.md Outdated
Comment on lines 454 to 451
Both outputs bundle the compiled libraries alongside headers and pkg-config
manifests.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ This also uses naming that is unknown to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated, please take a look

Comment on lines +4 to +33
workflow_call:
inputs:
build-type:
description: CMake build type used for packaging
type: string
default: Release
extra-cmake-flags:
description: Additional flags passed to CMake configure step
type: string
default: ""
save-artifacts:
description: Save built packages as artifacts
type: boolean
default: false
secrets: {}
workflow_dispatch:
inputs:
build-type:
description: CMake build type used for packaging
type: string
default: Release
extra-cmake-flags:
description: Additional flags passed to CMake configure step
type: string
default: ""
save-artifacts:
description: Save built packages as artifacts
type: boolean
default: false
secrets: {}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 It's a pity we need to be that WET instead of DRY. Chat GPT, however, hasn't come up with a better solution for enabling both manual dispatch and being called from another workflow, both with the same parameters and configuration.

Makefile Outdated
Comment on lines 3 to 5
SHELL = bash

SHELL = bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❓ Why the duplication?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just, copy-paste, fixed

Makefile Outdated
Comment on lines 5 to 6
SHELL = bash
ifeq ($(OS),Windows_NT)
SHELL := pwsh.exe
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 I believe it's an error to mix eager binding := operator with late binding operator = for the same variable. Do you agree?

sudo dpkg -i "${DRIVER_PACKAGES[@]}"
sudo apt-get install -f -y
- name: Build smoke-test application package
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏️ Let's add a missing (DEB and RPM) suffix, so this step's name isconsistency with other steps ((DEB) only) is explicit.

@wprzytula wprzytula added this to the 1.0.0 milestone Oct 7, 2025
@dkropachev dkropachev force-pushed the dk/switch-to-cpack-for-packaging branch 8 times, most recently from cd1ba37 to 53b56dc Compare October 9, 2025 21:21
@dkropachev dkropachev force-pushed the dk/switch-to-cpack-for-packaging branch 3 times, most recently from e12fbe9 to 6e2fe62 Compare January 1, 2026 03:06
@dkropachev dkropachev force-pushed the dk/switch-to-cpack-for-packaging branch from bc27f0e to 30d8b6e Compare January 18, 2026 07:29
dkropachev and others added 10 commits January 18, 2026 04:36
Remove legacy debian, redhat, and homebrew packaging scripts that are
being replaced by CPack-based packaging.

Removed:
- dist/debian/ - deb build scripts and debian control files
- dist/redhat/ - rpm spec and build scripts
- dist/homebrew/ - homebrew formula
Add CPack configuration for cross-platform package generation:
- DEB and RPM packages on Linux
- productbuild and DragNDrop on macOS
- WIX installer on Windows

Configure component-based packaging with runtime and dev components.
Add RunMacProductbuild.cmake helper for macOS package generation.
Update scylla-rust-wrapper CMakeLists.txt with proper install targets
and component assignments.
Add cross-platform packaging support to Makefile:
- OS detection (linux/macos/windows)
- build-driver, build-package, install-package targets
- Dependency installation helpers for each platform
- Normalize variable assignments for consistency

Adds targets:
- .package-build-prepare: install build dependencies
- .package-configure: configure CMake with appropriate settings
- build-driver: build the driver library
- build-package: create platform-specific packages
- install-package: install packages locally for testing
Add new GitHub Actions workflows for CPack-based packaging:
- build-cpack-packages.yml: build packages on Linux, macOS, Windows
- release-upload-packages.yml: upload artifacts on release

Update existing workflows:
- pkg.yml: simplify to use new CPack-based approach
- build-lint-and-test.yml: use consistent make command
Add a standalone smoke test application to validate installed packages:
- CMakeLists.txt: cross-platform build configuration
- Makefile: convenient build and test targets
- docker-compose.yml: ScyllaDB container for testing
- src/smoke_test.c: simple connection test

The smoke test verifies that installed packages work correctly by
connecting to a ScyllaDB instance and performing basic operations.
Fix flaky integration tests:
- test_heartbeat.cpp: adjust timing for more reliable heartbeat detection
- test_dc_aware_policy.cpp: minor stability fix

Refactor testing utilities:
- testing.cpp/hpp: improve test helper functions
- testing_rust_impls.h: update FFI declarations
- cass_error.rs: adjust error handling for tests
Update README.md with new CPack-based packaging instructions.
Update MAINTENANCE.md with revised release process using CPack.
- .gitignore: add packaging-related entries
- cmake/FindOpenSSL.cmake: improve OpenSSL path detection
- cmake/CMakeCargo.cmake: fix cargo build integration
Move .ONESHELL directive to global scope (was Windows-only) and remove
unnecessary "; \" line continuations and @{ } blocks now that all recipe
lines run in a single shell invocation.

Co-Authored-By: Claude Opus 4.5 <[email protected]>
@dkropachev dkropachev force-pushed the dk/switch-to-cpack-for-packaging branch from fe07754 to 2fc7774 Compare January 18, 2026 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants